<?php echo '<?xml version="1.0" encoding="UTF-8"?>' ?>

<user xmlns="http://leganto.com/api">

	<id>{$user->getId()}</id>

	<name>{$user->nickname}</name>

	<registrated>{$user->inserted}</registrated>

	{if !empty($user->lastLogged)}
	<last-logged>{$user->lastLogged}</last-logged>
	{/if}

	{if !empty($user->birthyear)}
	<birth-year>{$user->birthyear}</birth-year>
	{/if}

	{if !empty($user->sex)}
	<sex>{$user->sex}</sex>
	{/if}

	{if !empty($shelves)}
		<shelves>
		{foreach $shelves AS $shelf}
			<shelf>
				<id>{$shelf->getId()}</id>
				<type>{$shelf->type}</type>
				<name>{$shelf->name}</name>
				<number-of-books>{$shelf->numberOfBooks}</number-of-books>
			</shelf>
		{/foreach}
		</shelves>
	{/if}

</user>